package com.qiaoanju.back.service.impl.system;

import com.qiaoanju.back.dao.system.IRoleDao;
import com.qiaoanju.back.domain.system.RoleModel;
import com.qiaoanju.back.service.system.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by eversec on 2017/10/10.
 */
@Service
public class IRoleServiceImpl implements IRoleService {

    @Autowired
    private IRoleDao dao ;
    /**
     * 根据groupId获取角色
     *
     * @param groupId
     * @return
     */
    public List<RoleModel> getRoleByGroupId(int groupId) {

        return dao.getRoleByGroupId(groupId);
    }

    public List<RoleModel> getRolesList(Map<String, Object> params) {
        return dao.getRolesList(params);
    }

    public int insert(RoleModel role) {
        return dao.insert(role);
    }
    /**
     * 批量删除
     * @param ids
     * @return
     */
    public int deleteByIds(int[] ids) {
        return dao.deleteByIds(ids);
    }

    public int deleteById(int id) {
        return dao.deleteById(id);
    }

    public RoleModel getRoleById(int id) {
        return dao.getRoleById(id);
    }

    public boolean edit(RoleModel editModel) {
        return dao.edit(editModel);
    }
}
